package com.centerm.eterm.test.tool;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

import com.centerm.eterm.data.B64Util;

public class PrintUtil {
	public static void createBase64File(String filepath) throws IOException{
		BufferedReader br = new BufferedReader(new FileReader(new File(filepath)));
		StringBuilder str = new StringBuilder("");
		String tmp = null;
		while((tmp=br.readLine())!=null)
			str.append(tmp+"\r\n");
		File file = new File("C:\\Program Files\\centerm\\ccb\\print.txt");
		if(file.exists()==false){
			file.getParentFile().mkdirs();
			file.createNewFile();
		}
		FileWriter writer = new FileWriter(file,false);
		writer.write(B64Util.getFromBASE64(str.toString()));
	}
}
